package com.example.redisdemo.configuration;

import com.example.redisdemo.interfacer.UUIDSerial;
import com.example.redisdemo.interfacer.impl.SnowFlakeSerialCode;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author hexinglin
 * @created 2021-08-10 16:50
 **/
@Configuration
public class UUIDconfig {
    @Bean
    @ConditionalOnMissingBean(UUIDSerial.class)
    public UUIDSerial snowFlakeSerialCode() {
        return new SnowFlakeSerialCode();
    }
}
